/* eslint-disable camelcase,@typescript-eslint/no-unused-vars */ // DO NOT EDIT THIS FILE. AUTO-GENERATED BY mobiletto-orm-typedef-gen import { H3Event } from "h3"; export default defineEventHandler(async (event: H3Event) => { return await filterErrors(event, "destination.lookup", async (event: H3Event) => { return await requireAdminAccountObject(event, "destination.lookup", async (event: H3Event, session, account) => { const destinationRepo = destinationRepository(); const id = event?.context?.params?.id; if (!id) throw notFound(destinationRepo.typeDef.idFieldName()); const destination_by_id = await destinationRepo.safeFindById(id); if (destination_by_id) return destination_by_id; const destination_by_name = await destinationRepo.safeFindFirstBy("name", id); if (destination_by_name) return destination_by_name; throw notFound(id); }); }); });